Skip to main content

Get Environment Variable

AutomatR.DefaultActivities.Environment.GetEnvironmentVariable

The "Get Environment Variable" activity in AutomatR allows you to retrieve the contents of a specified environment variable. This activity enhances the flexibility of automation workflows by providing access to environment-specific values.

Properties

NameDescription
Input
Variable NameEnter the name of the environment variable whose value is to be retrieved.
TargetSelect the type of environment variable to be retrieved (e.g., Process, User, or Machine).
Misc
Display NameProvides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variable or argument containing the desired display name.
Optional
DelaySpecifies the amount of time (in seconds) to wait before executing the "Get Environment Variable" activity. This can be useful for handling synchronization issues. Integer variable or argument containing the delay duration. Example: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1.
Output
Variable ValueReturns the value of the selected environment variable as a string. String variable or argument to store the obtained variable value.

How to use:

  1. Drag and drop the "Get Environment Variable" activity onto the workflow.
  2. Configure the properties by specifying the name of the environment variable and selecting the target type (Process, User, or Machine).
  3. Optionally, configure the delay and customize the display name.
  4. Execute the workflow to retrieve the value of the specified environment variable.

Example: Consider an example where the "Get Environment Variable" activity is used to retrieve the value of the "TEMP" environment variable:

Get Environment Variable:
Display Name: "Get TEMP Variable"
Variable Name: "TEMP"
Target: Process
Variable Value: tempValue

In this example, the activity retrieves the value of the "TEMP" environment variable for the current process, and the result is stored in the string variable "tempValue" for further use in the workflow.